//      ui.h
//      
//      Copyright 2012 Mukesh <mukesh_fun2010.in>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.


#ifndef UI_H
#define UI_H

#include <gtk/gtk.h>
#include <gmodule.h>
#include "../common.h"
#include "../plugin.h"
#include "../gesbian.h"
#include "../module.h"

typedef struct _GesbianUI {
	/* As for now, the toplevel widget we return is a GtkPaned
	 * wrapped in a vbox.
	 * It is the responsibility of the caller function to do
	 * something useful with it.
	 */
	
	/* The module for this ui. We will have one module associated
	 * with one ui, which shall be activated only once, and shall
	 * be destroyed with it. 
	 * 
	 * 						Window
	 * 						   |
	 * 					----------------
	 * 					 |	 |   |     |
	 * 					Tab	Tab  Tab  Tab
	 * 					 |
	 * 					-------
	 * 					|     |
	 * 					UI  GModule
	 */
		
	GesbianPlugin * plugin ;
	
	// This is the GesbianModule, but we don't call it that yet
	/// We cannot have this here. Recursive includes is bad
	/// programming, and there is no point of object oriented
	/// programming if objects are linked both ways
//	Gesbian * g ;
	
	// Has to be initialized to NULL
	GesbianModule * module ;
	
	// This is what is returned
	GtkWidget * master ; 
	
	// These are "inherited"
	GtkWindow * window ;
	GtkNotebook * notebook ;

	GtkToolbar * toolbar ;
	GtkWidget * addressbar ;

	GtkEntry * locationbar ;

	GtkWidget * status ;
	GtkStatusbar * statusbar ;
	GtkProgressBar * progressbar ;
	
	GtkWidget * title ;
	GtkSpinner * spinner ;

	GtkPaned * paned ;
	GtkIconView * iconview ;
	
	// preview
	GtkWidget * preview ;
	GtkLabel * label ;
	GtkImage * image ;
	GtkScrolledWindow * iconview_sw1, * sw2 ;
	GtkListStore * store ;
} GesbianUI ;

typedef enum _GesbianUIRole {
	GESBIAN_UI_WINDOW,
	GESBIAN_UI_TAB,
	GESBIAN_UI_UNKNOWN
} GesbianUIRole ;

GesbianUI * gesbian_ui_tab_new ( void ) ;
GesbianUI * gesbian_ui_new ( void ) ;

void gesbian_ui_update ( void ) ;
void gesbian_ui_go_button ( GtkWidget * widget, GesbianUI * ui ) ;
#endif /* UI_H */
